<%--
  Created by IntelliJ IDEA.
  User: 小柒的Java
  Date: 2021/5/24
  Time: 7:53
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Book Login  in</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!--可无视-->
    <link rel="stylesheet" href="css/login_css/bootstrap.min.css">

    <!--主要样式-->
    <link type="text/css" href="css/login_css/style.css" rel="stylesheet" />

    <%--处理注册的异步请求--%>
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/jquery-3.5.1.js"></script>
    <script type="text/javascript">
        flag=false;

        /*检查标签中的内容格式*/
        function checkQian(){
            $("#index-username").val()

        }

        $(function () {
            /*电话号码输入框绑定失焦事件*/
            $("index-phone").blur(function () {
                // 获取输入框的值
                let phone = $("#index-phone").val();
                // 发起ajax请求
                $.ajax({
                    url:"indexServlet",
                    data:{
                        "index-phone":phone
                    },
                    dataType:"json",
                    success:function (resp) {
                        $("#overPhone").hidden
                       $("#overPhone").val(resp.msg);
                    }
                })

            })
        })

    </script>

</head>
<body background="images/login_images/banner.jpg">

<div class="container" align="center">
    <div class="col-md-6" style="margin-top: 20%;">
        <div class="inset">

            <form name="login" id="login" method="post" action="${pageContext.request.contextPath}/indexServlet">
                <input type="hidden" name="enews" value="login">

                <div>
                    <h2>YuChenBook</h2>
                    <div style="background-color: #c6c8ca">
                        <h5 id="massage">
                        </h5>
                    </div>
                    <span style="text-align: left;text-indent: 0.4em;"><label>用户名</label></span>
                    <span><input type="text" id="index-username" name="index-username"  class="textbox" ></span>
                </div>

                <div>
                    <span style="text-align: left;text-indent: 0.4em;"><label>密码</label></span>
                    <span><input id="index-password"  name="index-password" type="password" class="password" placeholder="请输入密码"></span>
                </div>

                <div>
                    <span style="text-align: left;text-indent: 0.4em;"><label>确认密码</label></span>
                    <span><input id="do-index-password" name="do-index-password" type="password" class="password" placeholder="请确认密码"></span>
                </div>

                <div>
                    <span style="text-align: left;text-indent: 0.4em;"><label>电话号码</label></span>
                    <span><input  name="index-phone" id="index-phone" type="text" class="index-phone" placeholder="请输入您的电话号码"></span>
                    <span id="overPhone" hidden="hidden"></span>
                </div>

                <div class="sign">
                    <input type="submit" value="注册" class="submit" id="user-index-btn"/>
                </div>
            </form>
        </div>
    </div>
</div>

</body>
</html>
